'use strict';

const Service = require('egg').Service;

class SocketDate extends Service {

  constructor(ctx) {
    super(ctx);
    this.dateTimer = null;
  }

  createTimer(func) {
    this.dateTimer = setInterval(() => {
      func();
    }, 1000);
  }

  clearTimer() {
    clearInterval(this.dateTimer);
  }
}

module.exports = SocketDate;
